/**
 * 首页tab相关接口
 */
import type { ReadResult, ReadingBookResult, TipsResult } from './types';
import { get, post } from '@/utils/request';

enum URL {
  getreadTaskRate = '/userMainPage/getreadTaskRate',
  getTips = '/userMainPage/getTips',
  getReadResult = '/userMainPage/getReadResult',
  getReadingBook = '/userMainPage/getReadingBook',
  getCategory = '/userMainPage/getCategory',
}

// 获取阅读任务 百分比
export const getreadTaskRate = () => post<any>({ url: URL.getreadTaskRate });

// 首页提示
export const getTips = () => get<TipsResult>({ url: URL.getTips });

// 查询阅读成果
export const getReadResult = () => get<ReadResult>({ url: URL.getReadResult });

// 查询 正在阅读的书
export const getReadingBook = () => get<ReadingBookResult>({ url: URL.getReadingBook });

// 获取书的标签字典值
export const getCategory = () => get<{ [key: string]: string }>({ url: URL.getCategory });
